<%inherit file="/base.mako"/>
${h.link_to('List', h.url_for(action='index', id=None))}
<br/>
Name: ${c.product.name}
<br/>
Brand: ${c.product.brand.name if c.product.brand != None else None}
<br/>
Category: ${c.product.category.name}
<br/>
Description: ${c.product.description}
<br/>
% for item in c.product.category.properties:
${item.code}: ${c.product.properties.get(item.code)}
<br/>
% endfor

<br/>
Comments:
${show_comment(c.product.root_comment)}

<%def name="show_comment(comment)">
<br/>
% if comment.parent_comment :
<b>${comment.author_name} : ${comment.created}</b><br/>
${comment.text}
% endif
${h.link_to('add comment', h.url_for(controller='comment', action='add', id=comment.id))}
% for child_comment in comment.child_comments:
${show_comment(child_comment)}
% endfor
</%def>
